<div class="card border-info m-3">
    <h5 class="card-header bg-info text-white">修改</h5>
    <div class="card-body">
        <div class="row">
            <div class="col-6">
                <h5 class="card-title">基础信息</h5>
            </div>
            <div class="col-6">
                <app-show-user-partin-info [data]="drawInfo?.domain"></app-show-user-partin-info>

            </div>
        </div>

        <p class="card-text">请按内容提示，录入相关信息。</p>
        <div class="row mb-3">
            <div class="col-6">
                <div class="input-group">
                    <div class="input-group-prepend w-25">
                        <button class="btn btn-info border-info w-100" type="button">编号</button>
                    </div>
                    <input type="text" class="form-control border-info" [(ngModel)]="domain.serNum">
                </div>
                <span class="badge badge-danger" *ngIf="errRes.error?.detail['DraFreeLottery.serNum'] !== null">{{errRes.error?.detail['DraFreeLottery.serNum']}}</span>
            </div>
            <div class="col-6">
                <div class="input-group">
                    <div class="input-group-prepend w-25">
                        <button class="btn btn-info border-info w-100" type="button">备注</button>
                    </div>
                    <input type="text" class="form-control border-info" [(ngModel)]="domain.serMemo">
                </div>
            </div>
        </div>
        <div class="row mb-3">
            <div class="col-6">
                <div class="input-group">
                    <div class="input-group-prepend w-25">
                        <button class="btn btn-info border-info w-100" type="button">商品名称</button>
                    </div>
                    <input type="text" class="form-control border-info" [(ngModel)]="domain.serGoodsDrawPname">
                </div>
                <span class="badge badge-danger"
                      *ngIf="errRes.error?.detail['DraFreeLottery.serGoodsDrawPname'] !== null">{{errRes.error?.detail['DraFreeLottery.serGoodsDrawPname']}}</span>
            </div>
            <div class="col-6">
                <div class="input-group">
                    <div class="input-group-prepend w-25">
                        <button class="btn btn-info border-info w-100" type="button">抽奖活动名称</button>
                    </div>
                    <input type="text" class="form-control border-info" [(ngModel)]="domain.serGoodsDrawName">
                </div>
            </div>
        </div>
        <div class="row mb-3">
            <div class="col-6">
                <div class="input-group">
                    <div class="input-group-prepend w-25">
                        <button class="btn btn-info border-info w-100" type="button">商品总价值</button>
                    </div>
                    <input type="text" class="form-control border-info" [(ngModel)]="domain.serGoodsDrawPrice">
                </div>
                <span class="badge badge-danger"
                      *ngIf="errRes.error?.detail['DraFreeLottery.serGoodsDrawPrice'] !== null">{{errRes.error?.detail['DraFreeLottery.serGoodsDrawPrice']}}</span>
            </div>
            <!--下拉框-->
            <div class="col-6">
                <ng-select [dropdownPosition]="'top'"
                           [searchable]="true" bindLabel="name" bindValue="id"
                           placeholder="抽奖类型" tooltip="抽奖类型"
                           [items]="[{id:'QIANRENTUAN',name:'千人团'},{id:'BAIRENTUAN',name:'百人团'},{id:'SHIRENTUAN',name:'十人团'}]"
                           [(ngModel)]="domain.serGoodsDrawPeople">
                </ng-select>
                <span class="badge badge-danger"
                      *ngIf="errRes.error?.detail['DraFreeLottery.serGoodsDrawPeople'] !== null">{{errRes.error?.detail['DraFreeLottery.serGoodsDrawPeople']}}</span>
            </div>
        </div>
        <div class="row mb-3">
            <!--下拉框-->
            <div class="col-6">
                <!--                <ng-select [dropdownPosition]="'top'"
                                           [searchable]="true" bindLabel="name" bindValue="id"
                                           placeholder="品牌选择" tooltip="选择品牌"
                                           [items]="[{id:'uuid',name:'品牌1'},{id:'uuid2',name:'品牌2'},{id:'uuid3',name:'品牌3'}]"
                                           [(ngModel)]="domain.serGoodsDrawBrand">
                                </ng-select>-->
                <ng-select
                        [items]="extend.domain.serGoodsDrawBrand.items"
                        [multiple]="false"
                        [closeOnSelect]="true"
                        [searchable]="true"
                        bindLabel="name" bindValue="id"
                        placeholder="{{extend.domain.serGoodsDrawBrand.nickname}}" tooltip="{{extend.domain.serGoodsDrawBrand.nickname}}"
                        [(ngModel)]="domain.serGoodsDrawBrand"
                        (change)="extend.domain.serGoodsDrawBrand.change($event)">
                </ng-select>
                <span class="badge badge-danger"
                      *ngIf="errRes.error?.detail['DraFreeLottery.serGoodsDrawBrand'] !== null">{{errRes.error?.detail['DraFreeLottery.serGoodsDrawBrand']}}</span>
            </div>

            <!--时间控制器-->
            <div class="col-6">
                <app-input-data-time [field]="extend.domain.serGoodsDrawStartDate"></app-input-data-time>
            </div>
        </div>
        <div class="row mb-3">
            <!--时间控制器-->
            <div class="col-6">
                <app-input-data-time [field]="extend.domain.serGoodsDrawEndDate"></app-input-data-time>
            </div>
            <!--时间控制器-->
            <div class="col-6">
                <app-input-data-time [field]="extend.domain.serGoodsDrawOpenDate"></app-input-data-time>
            </div>
        </div>
        <div class="row mb-3">
            <!--多图上传-->
            <div class="col-6">
                <ng-container aria-label="ossUpload">
                    <ng-container *ngFor="let file of extend.domain.files.fileUrls">
                        <div class="mb-2" style="border: 1px solid cadetblue; overflow: auto;">
                            <img [src]="file" style="height: 15rem;">
                            <p><span class="badge badge-success">{{file}}</span></p>
                            <button type="button" class="btn btn-sm btn-danger"
                                    (click)="extend.domain.files.del.click($event, file)">Del
                            </button>
                        </div>
                    </ng-container>
                    <input #file class="displayNone" type="file" ng2FileSelect
                           [uploader]="extend.domain.files.oss.uploader"
                           (change)="extend.domain.files.change($event)"/>
                </ng-container>
                <div class="input-group">
                    <div class="input-group-prepend w-25">
                        <button class="btn btn-info border-info w-100" type="button">轮播图</button>
                    </div>
                    <div class="input-group-append w-75">
                        <button class="btn btn-default border-info w-100" type="button" (click)="file.click()">选择
                        </button>
                    </div>
                </div>
                <span class="badge badge-danger"
                      *ngIf="errRes.error?.detail['DraFreeLottery.serGoodsDrawP1'] !== null">{{errRes.error?.detail['DraFreeLottery.serGoodsDrawP1']}}</span>
            </div>
            <!--视频上传-->
            <div class="col-6">
                <ng-container aria-label="ossUpload">
                    <div class="text-center mb-2" style="border: 1px solid cadetblue; overflow: auto;"
                         *ngIf="domain.serGoodsDrawView !== null && domain.serGoodsDrawView !== undefined && domain.serGoodsDrawView.length > 0">
                        <video [src]="domain.serGoodsDrawView" style="height: 15rem;"></video>
                        <p><span class="badge badge-success">{{domain.serGoodsDrawView}}</span></p>
                    </div>
                    <input #file3 class="displayNone" type="file" ng2FileSelect
                           [uploader]="extend.domain.fileGoodsDrawView.oss.uploader"
                           (change)="extend.domain.fileGoodsDrawView.change($event)"/>
                </ng-container>
                <div class="input-group">
                    <div class="input-group-prepend w-25">
                        <button class="btn btn-info border-info w-100" type="button">视频</button>
                    </div>
                    <div class="input-group-append w-75">
                        <button class="btn btn-default border-info w-100" type="button" (click)="file3.click()">选择
                        </button>
                    </div>
                </div>
                <span class="badge badge-danger"
                      *ngIf="errRes.error?.detail['DraFreeLottery.serGoodsDrawView'] !== null">{{errRes.error?.detail['DraFreeLottery.serGoodsDrawView']}}</span>
            </div>
        </div>
        <!--
                <div class="row mb-3">
                    <div class="col-6">
                        <div class="input-group">
                            <div class="input-group-prepend w-25">
                                <button class="btn btn-info border-info w-100" type="button">审核状态</button>
                            </div>
                            <input type="text" class="form-control border-info" [readonly]="true"
                                   [value]="extend.domain.serAudit()">
                            <input type="hidden" class="form-control border-info" [readonly]="true"
                                   [(ngModel)]="domain.serAudit">
                        </div>
                        <span class="badge badge-danger" *ngIf="errRes.error?.detail['DraFreeLottery.serAudit'] !== null">{{errRes.error?.detail['DraFreeLottery.serAudit']}}</span>
                    </div>
                    <div class="col-6">
                        <div class="input-group">
                            <div class="input-group-prepend w-25">
                                <button class="btn btn-info border-info w-100" type="button">启用状态</button>
                            </div>
                            <div class="input-group-append w-75">
                                <button btnCheckbox btnCheckboxTrue="ENABLE" btnCheckboxFalse="DISABLE"
                                        (click)="domain.serUsing = domain.serUsing === 'DISABLE' ? 'ENABLE' : 'DISABLE'"
                                        class="btn border-info w-100" type="button"
                                        [ngClass]="{'btn-primary': domain.serUsing === 'ENABLE', 'disabled btn-secondary': domain.serUsing === 'DISABLE'}">
                                    {{domain.serUsing === 'DISABLE' ? '禁用' : '启用'}}
                                </button>
                            </div>
                        </div>
                    </div>
                </div>

        -->
        <div class="row mb-3">
            <!--单图上传-->
            <div class="col-6">
                <ng-container aria-label="ossUpload">
                    <div class="text-center mb-2" style="border: 1px solid cadetblue; overflow: auto;"
                         *ngIf="domain.serGoodsDrawP2 !== null && domain.serGoodsDrawP2 !== undefined && domain.serGoodsDrawP2.length > 0">
                        <img [src]="domain.serGoodsDrawP2" style="height: 15rem;">
                        <p><span class="badge badge-success">{{domain.serGoodsDrawP2}}</span></p>
                    </div>
                    <input #file1 class="displayNone" type="file" ng2FileSelect
                           [uploader]="extend.domain.fileGoodsDrawP2.oss.uploader"
                           (change)="extend.domain.fileGoodsDrawP2.change($event)"/>
                </ng-container>
                <div class="input-group">
                    <div class="input-group-prepend w-25">
                        <button class="btn btn-info border-info w-100" type="button">宫格/搜索图</button>
                    </div>
                    <div class="input-group-append w-75">
                        <button class="btn btn-default border-info w-100" type="button" (click)="file1.click()">选择
                        </button>
                    </div>
                </div>
                <span class="badge badge-danger"
                      *ngIf="errRes.error?.detail['DraFreeLottery.serGoodsDrawP2'] !== null">{{errRes.error?.detail['DraFreeLottery.serGoodsDrawP2']}}</span>
            </div>
            <!--单图上传-->
            <div class="col-6">
                <ng-container aria-label="ossUpload">
                    <div class="text-center mb-2" style="border: 1px solid cadetblue; overflow: auto;"
                         *ngIf="domain.serGoodsDrawP3 !== null && domain.serGoodsDrawP3 !== undefined && domain.serGoodsDrawP3.length > 0">
                        <img [src]="domain.serGoodsDrawP3" style="height: 15rem;">
                        <p><span class="badge badge-success">{{domain.serGoodsDrawP3}}</span></p>
                    </div>
                    <input #file2 class="displayNone" type="file" ng2FileSelect
                           [uploader]="extend.domain.fileGoodsDrawP3.oss.uploader"
                           (change)="extend.domain.fileGoodsDrawP3.change($event)"/>
                </ng-container>
                <div class="input-group">
                    <div class="input-group-prepend w-25">
                        <button class="btn btn-info border-info w-100" type="button">长图</button>
                    </div>
                    <div class="input-group-append w-75">
                        <button class="btn btn-default border-info w-100" type="button" (click)="file2.click()">选择
                        </button>
                    </div>
                </div>
                <span class="badge badge-danger"
                      *ngIf="errRes.error?.detail['DraFreeLottery.serGoodsDrawP3'] !== null">{{errRes.error?.detail['DraFreeLottery.serGoodsDrawP3']}}</span>
            </div>
        </div>
        <div class="row mb-3">
            <div class="col-6">
                <ng-container aria-label="ossUpload">
                    <div class="text-center mb-2" style="border: 1px solid cadetblue; overflow: auto;"
                         *ngIf="domain.serGoodsDrawP4 !== null && domain.serGoodsDrawP4 !== undefined && domain.serGoodsDrawP4.length > 0">
                        <img [src]="domain.serGoodsDrawP4" style="height: 15rem;">
                        <p><span class="badge badge-success">{{domain.serGoodsDrawP4}}</span></p>
                    </div>
                    <input #file4 class="displayNone" type="file" ng2FileSelect
                           [uploader]="extend.domain.fileGoodsDrawP4.oss.uploader"
                           (change)="extend.domain.fileGoodsDrawP4.change($event)"/>
                </ng-container>
                <div class="input-group">
                    <div class="input-group-prepend w-25">
                        <button class="btn btn-info border-info w-100" type="button">瀑布流图</button>
                    </div>
                    <div class="input-group-append w-75">
                        <button class="btn btn-default border-info w-100" type="button" (click)="file4.click()">选择
                        </button>
                    </div>
                </div>
                <span class="badge badge-danger"
                      *ngIf="errRes.error?.detail['DraFreeLottery.serGoodsDrawP4'] !== null">{{errRes.error?.detail['DraFreeLottery.serGoodsDrawP4']}}</span>
            </div>
            <div class="col-6">
                <div class="input-group">
                    <div class="input-group-prepend w-25">
                        <button class="btn btn-info border-info w-100" type="button">抽奖所需劵数</button>
                    </div>
                    <input type="text" class="form-control border-info" [(ngModel)]="domain.serGoodsDrawRefurbish">
                </div>
                <span class="badge badge-danger"
                      *ngIf="errRes.error?.detail['DraFreeLottery.serGoodsDrawRefurbish'] !== null">{{errRes.error?.detail['DraFreeLottery.serGoodsDrawRefurbish']}}</span>
            </div>
        </div>
        <div class="col-6">
            <ng-select [dropdownPosition]="'top'"
                       [searchable]="true" bindLabel="name" bindValue="id"
                       placeholder="中奖号码" tooltip="中奖号码"
                       [items]="extend.domain.serGoodsDrawNumber.items"
                       [(ngModel)]="domain.serGoodsDrawNumber">
            </ng-select>
            <span class="badge badge-danger"
                  *ngIf="errRes.error?.detail['DraFreeLottery.serGoodsDrawNumber'] !== null">{{errRes.error?.detail['DraFreeLottery.serGoodsDrawNumber']}}</span>
        </div>
    </div>

    <div class="row mb-3">
            <div class="col-12">
                <h4>商品描述</h4>
                <div [froalaEditor]='froalaEditorOptions' [(froalaModel)]="domain.serGoodsDrawDesc">Hello, Froala!</div>
            </div>
        </div>
    <div class="row mb-3">

        <!--
                <div class="row mb-3">
                    <div class="col-6">
                        <div class="input-group">
                            <div class="input-group-prepend w-25">
                                <button class="btn btn-info border-info w-100" type="button">serValid</button>
                            </div>
                            <input type="text" class="form-control border-info" [value]="'serValid'">
                        </div>
                        <span class="badge badge-danger" *ngIf="errRes.error?.detail['DraFreeLottery.serValid'] !== null">{{errRes.error?.detail['DraFreeLottery.serValid']}}</span>
                    </div>
                    <div class="col-6">
                        <div class="input-group">
                            <div class="input-group-prepend w-25">
                                <button class="btn btn-info border-info w-100" type="button">serValid2</button>
                            </div>
                            <input type="text" class="form-control border-info" [value]="'serValid2'">
                        </div>
                        <span class="badge badge-danger" *ngIf="errRes.error?.detail['DraFreeLottery.serValid2'] !== null">{{errRes.error?.detail['DraFreeLottery.serValid2']}}</span>
                    </div>
                </div>
        -->

        <div class="text-center mt-5">
            <button type="button" class="btn btn-outline-primary" (click)="func.update.req($event)">修改</button>
        </div>
    </div>
</div>

<span class="badge badge-info mr-3" *ngIf="errRes?.error?.timestamp !== null">response time: {{errRes?.error?.timestamp}}</span>

<div *ngIf="false">
    <p>{{errRes?.error}}</p>
    <p>{{errRes?.error?.code}}</p>
    <p>{{errRes?.error?.description}}</p>
    <p>{{errRes?.error?.theme}}</p>
    <p>{{errRes?.error?.timestamp}}</p>
    <p>{{errRes?.error?.detail?.RR?.duration}}</p>
    <p>{{errRes?.error?.detail['DraFreeLottery.serNum']}}</p>
    <p>{{errRes?.error?.detail['DraFreeLottery.serAudit']}}</p>
    <p>{{errRes?.error?.detail['DraFreeLottery.serValid']}}</p>
    <p>{{errRes?.error?.detail['DraFreeLottery.serValid2']}}</p>
    <p>{{errRes?.headers}}</p>
    <p>{{errRes?.message}}</p>
    <p>{{errRes?.name}}</p>
    <p>{{errRes?.ok}}</p>
    <p>{{errRes?.status}}</p>
    <p>{{errRes?.statusText}}</p>
    <p>{{errRes?.url}}</p>
</div>
